<?php
include("admin/cls/sesion.php");
session_start();
if(!$_SESSION[""]->nombre)
	{
		header("Location:index.html");
	}
    $_SESSION[""]->nombre;
     $user_id=$_SESSION[""]->id;

	//recorres para obtener los datos
	echo "<table>";
	echo "<tr>";
	include("admin/cls/cls_user.php");
	$user = new cls_user ();
	$var=$user->getImageUser($user_id);
	echo "<table>";
	while($mostrar = mysql_fetch_array($var)){
	$image_name=$mostrar['image_name'];
	$image_id=$mostrar['image_id'];
	//$dir_file='files_users/'.$image_name;
	//echo "direccion".$dir_file;
	echo "<tr>";
	echo "<td bgcolor='white'><a href='files_users/$image_name'>";
	echo "<img src='getImages.php?image_id=$image_id' WIDTH=100 HEIGHT=100></a>";
	echo"
		<table>
			<form action=imageProfile.php method=post enctype=multipart/form-data> 
				 <input type=hidden name=image_id value=$image_id />
				 <input type=hidden name=user_id value=$user_id />
				<input name=enviar type=submit value=Foto_Perfil />    
			</form>
		</table>";
	echo "</td>"; 
	echo "</tr>";
	echo "<tr>";
	echo "<td>";
	echo "<br/>";
	echo $image_name;
	echo "<br/>";
	echo "<a href='#' onClick=javascript:deleteUserImage($user_id,$image_id,'".$image_name."');>Eliminar Imagen</a>";
	echo "</td>";
	echo "</tr>";
	}
	echo"</table>";
		
	/*utilizaremos este codigo para cuando
				demos clic sobre el tumbs
				<?php
			include("admin/cls/cls_usuarios.php");
			$usuario = new cls_usuarios ();
			$var=$usuario->getImageUser($user_id);
			//recorres para obtener los datos
			echo "<table>";
			while($mostrar = mysql_fetch_array($var)){
			$image_name=$mostrar['image_name'];
			echo "<tr>";
			echo "<td>";
			echo "<img src=files_users/$image_name />";
			echo "image".$image_name;
			echo "</td>";
			echo "</tr>";
			
			}
			echo"</table>";
		?>
			*/